<!--
 * @Author: 王雁鹏
 * @Date: 2023-04-07 21:52:09
 * @LastEditTime: 2023-04-08 17:44:54
 * @LastEditors: Please set LastEditors
 * @Description: 
 * @FilePath: \expressf:\weapp\tie-quan1\src\pages\index\index.vue
 * -------------------------------------
-->
<!--
 * @Author: 王雁鹏
 * @Date: 2023-04-07 21:52:09
 * @LastEditTime: 2023-04-08 09:26:11
 * @LastEditors: Please set LastEditors
 * @Description: 
 * @FilePath: \assistf:\weapp\tie-quan1\src\pages\index\index.vue
 * -------------------------------------
-->
<template>
    <view class="index">
        <view>
            <img src="" alt="">
        </view>
        {{ msg }}
        <Dongdong />
        <view class="btn">
            <nut-button type="primary" @click="handleClick('text', msg2, true)">点我13</nut-button>
        </view>
        <nut-toast :msg="msg2" v-model:visible="show" :type="type" :cover="cover" />
    </view>
</template>

<script>
import { reactive, toRefs, onMounted } from 'vue';
import Taro from '@tarojs/taro'
import { Dongdong } from '@nutui/icons-vue-taro';
export default {
    name: 'Index',
    components: {
        Dongdong
    },
    setup() {
        const state = reactive({
            msg: '铁拳杂货铺',
            msg2: '这是个弹窗',
            type: 'text',
            show: false,
            cover: false
        });
        const mounted = onMounted(() => {
            console.log("进行路由跳转")
            Taro.switchTab({
                url: '/pages/home/index'
            })
        })
        const handleClick = (type, msg, cover = false) => {
            state.show = true;
            state.msg2 = msg;
            state.type = type;
            state.cover = cover;

        };

        return {
            mounted,
            ...toRefs(state),
            handleClick
        }
    }
}
</script>

<style lang="scss">
.index {
    font-family: "Avenir", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
}
</style>
